<template>
	<view>
		<view v-for="(item,index) in getAgreementData" @click="agreement(item)">
			<view class=" padding align-center rowsb bg-white solid-bottom1">
				<view>{{item.title}}</view>
				<view class="arrow"></view>
			</view>
		</view>
		<view class=" round padding margin  text-center text-xl text-white " style="background-color: #E70422;" @click="setlogin">
			<view>退出登录</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getAgreementData: [{
						title: '用户协议',
						id:1
					},
					{
						title: '隐私协议',
						id:2
					},
					{
						title: '关于我们',
						id:3
					}
				]
			}
		},
		onLoad() {},
		methods: {
			setlogin() {
				let that = this
				uni.showModal({
					title: '温馨提示',
					content: '确定要退出登录吗？',
					success: function(Res) {
						if (Res.confirm) {
							that.$tools.showToast('退出成功')
							setTimeout(r => {
							uni.clearStorageSync()
								uni.reLaunch({
									url: '../home/home/home'
								})
							}, 1000)

						} else if (Res.cancel) {
							console.log('用户点击取消');
						}
					}
				})

			},
			agreement(item) {
				uni.navigateTo({
					url: '../plugins/agreement?title='+item.title+'&id=' +item.id
				})
			}

		}
	}
</script>

<style>
	page {
		background-color: #F5F5F5;
	}

	.solid-bottom1 {
		border-bottom: 1rpx solid #f1f1f1;
	}
</style>
